package com.hub.controller;

import com.hub.utils.ApiCodeEnum;
import com.hub.utils.ApiResultObject;
import com.hub.utils.KeyValueModel;
import com.hub.utils.enums.UnitEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hub
 * @version 1.0
 * @date 2020/5/19 10:26
 * @description:
 */
@Slf4j
@Api(value="参数信息相关API",tags={"参数信息" })
@RestController
@RequestMapping("/param")
public class ParamController {


    @ApiOperation("获取单位列表")
    @GetMapping(value = "/unit")
    public ApiResultObject GetUnitList(){

        List<KeyValueModel> list = UnitEnum.getMaps();
        return ApiResultObject.success(ApiCodeEnum.SUCCESS.getCode(),"",list);
    }
}
